package com.sn.flink.streaming.customer.source;

import org.apache.flink.streaming.api.functions.source.SourceFunction;

public class NoParalleSource implements SourceFunction<Long> {

    private Long count = 0L;
    private boolean isRunning = true;

    @Override
    public void run(SourceContext sourceContext) throws Exception {
        while (isRunning) {
            sourceContext.collect(count);
            count++;
            Thread.sleep(1000);
        }
    }

    @Override
    public void cancel() {

    }
}
